<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>注册</title>
	<script>
		function check(){
			var password1 = document.getElementById("password").value;
			var password2 = document.getElementById("password2").value;
			var userName = document.getElementById("userName").value;
			var nickName = document.getElementById("nickName").value;
			if(userName == null || userName.length == 0) {
				alert("请填写用户名!");
				return false;
			}
			if(nickName == null || nickName.length == 0) {
				alert("请填写姓名!");
				return false;
			}
			if(password1 == null || password1.length == 0) {
				alert("请填写密码!");
				return false;
			}
			if(password2 == null || password2.length == 0) {
				alert("请填写确认密码!");
				return false;
			}
			if(password1 != password2) {
				alert("密码不一致，请重新填写");
				return false;
			}
			document.getElementById("registForm").submit();
		}

	</script>
</head>
<body>
<h1>jianglai BBS</h1><br/>
<a href="/login/index.do">首页</a>
<form id="registForm" action="/login/regist.do" method="post">
	用户名：<input type="text" id="userName" name="userName"/><br>
	姓名：<input type="text" id="nickName" name="nickName"/><br>
	密码：<input type="password" id="password" name="password"/><br>
	确认密码：<input type="password" id="password2"/><br>
	<input type="button" value="注册" onclick="check()"/>
</form>
</body>
</html>